package com.fourth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //跳转首页（index.html）交给（GoodsController）控制方法"/goToIndex"完成
        registry.addViewController("/").setViewName("redirect:/goToIndex");
        registry.addViewController("/index.html").setViewName("index");
        registry.addViewController("/admin.html").setViewName("admin");
        registry.addViewController("/cart.html").setViewName("cart");
        registry.addViewController("/login.html").setViewName("login");
//        registry.addViewController("/js的Object.keys方法.html").setViewName("js的Object.keys方法");
//        registry.addViewController("/localStorage的用法.html").setViewName("localStorage的用法");
//        registry.addViewController("/vue的属性绑定.html").setViewName("仿京vue的属性绑定东注册");
        registry.addViewController("/register.html").setViewName("register");
        registry.addViewController("/settlement.html").setViewName("settlement");
        registry.addViewController("/showOrder.html").setViewName("showOrder");
    }
}
